package com.developer.platform.domain;

import cn.hutool.http.Method;
import com.baomidou.mybatisplus.annotation.TableName;
import com.developer.platform.infrastructure.enums.MenuEnum;
import com.developer.platform.infrastructure.enums.StatusEnum;
import com.veeker.mybatis.basic.BaseEntity;


/**
 * 资源
 *
 * @author ：qiaoliang
 * @date ：2020-10-16
 */
@TableName(value = "sys_menu",autoResultMap = true)
public class Menu extends BaseEntity<Long,Long> {
    /**父级ID**/
    private long parentId;
    /**中文标题**/
    private String title;
    /**标识**/
    private String mark;
    /**接口url**/
    private String url;
    /**接口类型**/
    private Method method;
    /**排序**/
    private int sort;
    /**状态**/
    private StatusEnum status;
    /**类型（M目录 C菜单 F按钮）**/
    private MenuEnum type;
    /**图标**/
    private String icon;
    /**路由地址**/
    private String path;
    /**路由路径**/
    private String component;
    /**路由名称**/
    private String name;
    /**
     *  反向修改状态
     *
     * @author ：qiaoliang
     * @date 2020-10-20 10:29
     */
    public void updateStatus(){
        this.setStatus(this.getStatus().equals(StatusEnum.Y)?StatusEnum.N:StatusEnum.Y);
    }

    public Menu() {
    }

    public Menu(long id) {
        super(id);
    }

    public long getParentId() {
        return parentId;
    }

    public void setParentId(long parentId) {
        this.parentId = parentId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMark() {
        return mark;
    }

    public void setMark(String mark) {
        this.mark = mark;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public StatusEnum getStatus() {
        return status;
    }

    public void setStatus(StatusEnum status) {
        this.status = status;
    }

    public MenuEnum getType() {
        return type;
    }

    public void setType(MenuEnum type) {
        this.type = type;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
